import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpEvent, HttpInterceptor, HttpHandler, HttpRequest, HttpErrorResponse} from '@angular/common/http';
import { throwError, observable } from 'rxjs'
import { catchError, retry } from 'rxjs/operators';
import { Subject,Observable } from 'rxjs';
import { ToastController } from '@ionic/angular';
@Injectable({
  providedIn: "root",
})
export class commstyleComponent {
         constructor(  
    
            public toastController: ToastController,) {}

/**
 * @param {any} type  类型 error 、tip、warn
 * @param {any} data  提示内容
 * @returns 
 * @memberOf commService
 */
 async presentToast(type,data){
    const toast = await this.toastController.create({
      // message:"<i class="+"toast"+type+"></i>123213" ,
      message:data,
      color:"secondary",
      duration: 2000,
      position:"top",
      cssClass:"setClass",
      translucent:false,
    });
    toast.present();

    // document.querySelector(".toasterror")
  }

  
  
}
